package cn.tedu.csmall.passport.security;

import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.ToString;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.User;

import java.util.Collection;

/**
 * 管理员登录信息详情类，用于Spring Security处理认证
 *
 * @author Chen
 * @since 2023/2/7 17:22:22
 */
@Getter
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class AdminDetails extends User {

    private static final long serialVersionUID = -5394269838217953737L;
    private final Long id;

    public AdminDetails(Long id, String username, String password, boolean enabled,
                        Collection<? extends GrantedAuthority> authorities) {
        super(username, password, enabled, true, true, true,
                authorities);
        this.id = id;
    }

}
